-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(ui) micro-frontend basic configuration #15069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(ui) micro-frontend basic configuration #15069
Conversation
DATAMGT-5231: micro-frontend basic configuration
Bundle ReportBundle size has no change ✅ |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
DATAMGT-5231: add MFEConfigurableContainer.tsx
| 'module', | ||
| 'flags', | ||
| 'permissions', | ||
| 'navIcon', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we want to keep navIcon required?
| */ | ||
| export function loadMFEConfigFromYAML(yamlString: string): MFESchema { | ||
| try { | ||
| console.log('[MFE Loader] Raw YAML:', yamlString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may be unnecessary and also can lead to exposure of unnecessary data. Also could be wrapped around only for dev environments if needed.
| } | ||
| const config = loadMFEConfigFromYAML(mfeYamlRaw); | ||
| if (config) { | ||
| console.log('[MFE Loader] useMFEConfigFromYAML loaded:', config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, we don't need to log this on every page
| throw new Error('[MFE Loader] Invalid YAML: missing microFrontends array'); | ||
| } | ||
| // Validate each entry, keeping both valid and invalid ones | ||
| parsed.microFrontends = parsed.microFrontends.map(validateMFEConfig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could also just filter out here instead of storing the InvalidMFEConfig and passing around.
ani-malgari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also may be i'm lacking context, how do you envision to provide the mfe config since the app will be bundled?
| } | ||
|
|
||
| export function useDynamicRoutes(): JSX.Element[] { | ||
| const mfeConfig = useMFEConfigFromYAML(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the idea here that this will be replaced one day with useMFEConfigFromRemote?
Basic setup for YAML-based configuration of micro frontends.
Includes tests and readme.
The config will be use in subsequent PRs